package com.chushouya.order.constants;


import com.general.framework.core.enums.IEnum;
import com.general.framework.core.lang.Strings;

import java.util.Objects;

public enum AlipayGatewayMethodEnum implements IEnum<String> {
    ALIPAY_COMMERCE_RECYCLE_CHARITY_NOTIFY("alipay.commerce.recycle.charity.notify", "公益回收推送证书"),
    ALIPAY_COMMERCE_RECYCLE_ENERGY_NOTIFY("alipay.commerce.recycle.energy.notify", "回收行业森林能量发放结果通知"),
    ZHIMA_CREDIT_PAYAFTERUSE_CREDITBIZORDER_CHANGED("zhima.credit.payafteruse.creditbizorder.changed", "用户签约芝麻速办"),
    ALIPAY_FUND_WALLET_OPEN_COMPLETED("alipay.fund.wallet.open.completed", "支付宝钱包开通通知"),
    ALIPAY_FUND_WALLET_WITHDRAW_COMPLETED("alipay.fund.wallet.withdraw.completed", "钱包提现异步通知"),
    ALIPAY_FUND_WALLET_REFUND_COMPLETED("alipay.fund.wallet.refund.completed", "钱包退款异步通知"),
    ALIPAY_FUND_TRANS_ORDER_CHANGED("alipay.fund.trans.order.changed", "支付宝转账订单状态变更通知"),
    ALIPAY_FUND_WALLET_PAYMENT_COMPLETED("alipay.fund.wallet.payment.completed", "支付宝钱包支付完成通知"),
    ZHIMA_CREDIT_PAYAFTERUSE_CREDITAGREEMENT_CHANGED("zhima.credit.payafteruse.creditagreement.changed", "用户签约芝麻速办"),
    ANT_MERCHANT_EXPAND_INDIRECT_ZFT_REJECTED("ant.merchant.expand.indirect.zft.rejected","直付通审核失败通知"),
    ANT_MERCHANT_EXPAND_INDIRECT_ZFT_PASSED("ant.merchant.expand.indirect.zft.passed","直付通审核成功通知"),
    ALIPAY_OPEN_MINI_ORDER_AFTERSALE_CHANGED("alipay.open.mini.order.aftersale.changed","订单售后消息通知"),
    ALIPAY_OPEN_MINI_ORDER_CHANGED("alipay.open.mini.order.changed","订单变更通知"),
    //ant.merchant.expand.shop.save.passed
    ANT_MERCHANT_EXPAND_SHOP_SAVE_PASSED("ant.merchant.expand.shop.save.passed","门店创建成功通知"),
    ANT_MERCHANT_EXPAND_SHOP_SAVE_REJECTED("ant.merchant.expand.shop.save.rejected","门店创建失败通知"),

    ;




    private String value;

    private String desc;

    AlipayGatewayMethodEnum(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public static String getDesc(String status) {
        for (AlipayGatewayMethodEnum thisEnum : AlipayGatewayMethodEnum.values()) {
            if (Objects.equals(thisEnum.value, status)) {
                return thisEnum.desc;
            }
        }
        return Strings.EMPTY;
    }
    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }
    /**
     * 通过value取枚举
     * @param value
     * @return
     */
    public static AlipayGatewayMethodEnum getTypeByValue(String value){
                for (AlipayGatewayMethodEnum enums : AlipayGatewayMethodEnum.values()) {
            if (enums.getValue() == value) {
                return enums;
            }
        }
        return null;
    }
    @Override
    public String value() {
        return this.value;
    }

    @Override
    public String named() {
        return this.desc;
    }
}
